﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace P2P.Client.Buffer
{
    public class P2PMessageBuffer
    {
        private static readonly object _lock = new object();

        private static P2PMessageBuffer? instance;

        private P2PMessageBuffer()
        {

        }

        public static P2PMessageBuffer Instance()
        {
            if (instance == null)
            {
                lock (_lock)
                {
                    if (instance == null)
                    {
                        instance = new P2PMessageBuffer();
                    }
                }
            }
            return instance;
        }

        public ConcurrentQueue<string> Buffer = new ConcurrentQueue<string>();
    }
}
